#ifndef ENTITYENEMY_H
#define ENTITYENEMY_H

#include "WorldEntity.h"

//!Represent an enemy
class CEntityEnemy : public CWorldEntity
{
private:
	//!Index of the texture representing the enemy walking to the left 
	int m_animWalkLeft;

	//!Index of the texture representing the enemy walking to the right 
	int m_animWalkRight;

	//!Range of displacement of the enemy
	int m_rangeOfDisplacement;

	//!Indicating if the enemy is facing the right or left
	bool m_goToTheRight;

	//!Initial position of the enemy
	CVector2i m_initialPosition;

	//!Speed of the enemy
	int m_speed;

	//! current sprite displayed from animation
	int m_idAnimSprite;

	//!Start display time of the current frame in the animation
	int m_animTime;

public:
	//!Constructor
	/*!
	\param initialPosition Initial position of the entity.
	\param range Range of displacement of the enemy.
	\param animWalkLeft Animation index of the enemy walking to the left.
	\param animWalkRight Animation index of the enemy walking to the right.
	\param hp Health point of the enemy.
	\param damagePoint Damage point cause by a collision
	\param speed Speed of the enemy.
	*/
	CEntityEnemy(const CVector2i& initialPosition, int range, int animWalkLeft, 
		int animWalkRight, int hp, int damagePoint, int speed);

	//!Destructor
	~CEntityEnemy(void);

	//!Update the entity
	void doUpdate(void);

	//!Render the entity.
	void doRender(void);

	//!Scroll the entity
	/*!
	\param scrollVector Translation vector for the scrolling.
	*/
	void scrollEntity(const CVector2i& scrollVector);

private:

	//!Reset the data of animation. This function is called when the animation to display changed.
	void resetAnimData(void);
};

#endif

